import request from "../request";
import { SHOP_ID } from "@/common/shop.contants";
export function getShopCategoryList() {
  return request({
    url: "/shop/goods/category/all",
    params: {
      shopId: SHOP_ID,
    },
  });
}

export function getShopGoodsList(cid, page = 1, pageSize = 50) {
  return request({
    url: "/shop/goods/list/v2",
    method: "post",
    params: {
      categoryId: cid,
      page,
      pageSize,
    },
  });
}

export function getGoodsDetail(id) {
  return request({
    url: "/shop/goods/detail",
    params: {
      id,
    },
  });
}

export function shopAddCart(obj) {
  return request({
    url: "/shopping-cart/add",
    method: "post",
    params: {
      ...obj,
    },
  });
}
